import React, { Component } from 'react'
//路由
import {Route,Switch, Redirect} from 'react-router-dom'

//基本设置 首页 用户管理
import Home from '../home/Home'

// 用户管理-用户
import Users from '../users/Users'
import Admin from '../users/Admin'
//404
import NotFound from '../notfound/NotFound'

//菜谱管理
import Recipe from '../recipe/Recipe'
import AddMenu from '../recipe/AddMenu'
// import Cuisine from '../recipe/Cuisine'

//特产管理
import SpecialtyList from '../specialty/SpecialtyList'
import SpecialtyCategory from '../specialty/SpecialtyCategory'


import Sidebar from './Sidebar'
import Topbar from './Topbar'




import Order from '../order/Order'
import {Layout} from 'antd';


// 引入css样式
import './Dash.css'



  
const { Content } = Layout;

export default class Dash extends Component {
    state = {
        collapsed: false,
      };
    render() {
        return (
            <div className="dashBox">
                <Layout style={{height:"100%"}}>
                    {/* //侧边栏 */}
                    <Sidebar></Sidebar>
                    <Layout className="site-layout">
                    {/* //顶层栏 */}
                    <Topbar></Topbar>
                    
                    <Content
                        className="site-layout-background"
                        style={{
                        margin: '24px 16px',
                        padding: 24,
                        minHeight: "auto",
                        }}
                    >
                       <Switch>
                           {/* 首页 */}
                            <Route path="/home" component={Home}/>
                            <Route path="/user-manage/users" component={Users}/>
                            <Route path="/user-manage/admin" component={Admin}/>

                            {/* 菜谱管理 */}
                            <Route path="/recipe-manage/recipe" component={Recipe}/>
                            <Route path="/recipe-manage/addMenu" component={AddMenu}/>
                            {/* 特产管理 */}
                            {/* <Route path="/specialty-manage/specialtyList" component={SpecialtyList}/>
                            <Route path="/specialty-manage/specialtycategory" component={SpecialtyCategory}/> */}
                            {/* 重定向 */}
                           

                            <Route path="/specialty-manage/specialtyList" component={SpecialtyList}/>
                            <Route path="/specialty-manage/specialtyCategory" component={SpecialtyCategory}/>
                          

                            <Route path="/order" component={Order}/>
                            
                            <Redirect from="/" to="/home" exact />

                            <Route path="*" component={NotFound} /> 
                       </Switch>
                    </Content>
                    </Layout>
                    </Layout>  
                </div>       
            )
    }
    
    toggle = () => {
        
        this.setState({
          collapsed: !this.state.collapsed,
        })
    }
}
